package cn.cvs.service.apply;

import cn.cvs.dao.apply.ApplyMapper;
import cn.cvs.pojo.Apply;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ApplyServiceImpl implements ApplyService {
	@Resource
	private ApplyMapper applyMapper;


	@Override
	public int save(Apply apply) {
		return applyMapper.add(apply);
	}

	@Override
	public List<Apply> queryPageList(String applyTime,Integer status, Integer pageIndex, Integer pageSize) {
		int pageBean = (pageIndex - 1) * pageSize;
		return applyMapper.selectList(applyTime,status,pageBean,pageSize);
	}

	@Override
	public int selectCount(String applyTime,Integer status) {
		return applyMapper.selectCount(applyTime,status);
	}

	@Override
	public int removeById(Integer id) {
		return applyMapper.deleteById(id);
	}

	@Override
	public Apply queryById(Integer id) {
		return applyMapper.selectById(id);
	}

	@Override
	public int modifyById(Apply apply) {
		return applyMapper.update(apply);
	}
}
